#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "CallAction.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Behavior;
class InputPin;
class Parameter;

/// <summary>
/// StartObjectBehaviorAction
/// A StartObjectBehaviorAction is an InvocationAction that starts the execution
/// either of a directly instantiated Behavior or of the classifierBehavior of an
/// object. Argument values may be supplied for the input Parameters of the
/// Behavior. If the Behavior is invoked synchronously, then output values may be
/// obtained for output Parameters.
/// </summary>
class UMLMODEL_EXPORT StartObjectBehaviorAction : public CallAction {

public: // Constructors and destructors
    explicit StartObjectBehaviorAction(const QString& umlType="uml::StartObjectBehaviorAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Methods
    /// <summary>
    /// outputParameters
    /// Return the inout, out and return ownedParameters of the Behavior being called.
    /// </summary>
    shared_ptr<vector<Parameter>> outputParameters() const override;

    /// <summary>
    /// inputParameters
    /// Return the in and inout ownedParameters of the Behavior being called.
    /// </summary>
    shared_ptr<vector<Parameter>> inputParameters() const override;

    /// <summary>
    /// behavior
    /// If the type of the object InputPin is a Behavior, then that Behavior. Otherwise,
    /// if the type of the object InputPin is a BehavioredClassifier, then the
    /// classifierBehavior of that BehavioredClassifier.
    /// </summary>
    virtual shared_ptr<Behavior> behavior() const;

public: // Properties
    /// <summary>
    /// object getter
    /// An InputPin that holds the object that is either a Behavior to be started or has
    /// a classifierBehavior to be started.
    /// </summary>
    shared_ptr<InputPin> object() const;

    /// <summary>
    /// object setter
    /// An InputPin that holds the object that is either a Behavior to be started or has
    /// a classifierBehavior to be started.
    /// </summary>
    void setObject(shared_ptr<InputPin> value);

private: // Fields
    /// <summary>
    /// object
    /// An InputPin that holds the object that is either a Behavior to be started or has
    /// a classifierBehavior to be started.
    /// </summary>
    shared_ptr<InputPin> object_;

};

} // namespace uml
